package com.jww.cloud.service.user.server.controller;

import com.jww.base.am.model.dos.SysResourceDO;
import com.jww.base.am.service.SysResourceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/resources")
@Api(value = "资源管理", tags = "资源管理")
public class SysResourceController {

    @Autowired
    private SysResourceService sysResourceService;

    @GetMapping
    @ApiOperation(value = "查询资源", notes = "根据用户名查询资源")
    public List<SysResourceDO> listByUsername(@RequestParam("username") String username) {
        return sysResourceService.listByUsername(username);
    }
}
